import os
import shutil
import glob
import time

class OperationFile:
	def __init__(self,direc):
		self.direc = direc
		#self.DirFile = DirFile()
		print("之前的工作目录为：{}；现在的工作目录为：{}，此目录下的文件及文件夹有：{}"\
			.format(self.DirFile[0],self.DirFile[1],self.DirFile[2]))
	
	def DirFile(self,file_class):
		pre_dir = os.getcwd()
		os.chdir(self.direc)
		now_dir = os.getcwd()
		file_list = glob.glob(file_class)
		return pre_dir,now_dir,file_list

	def CopyFile(self,the_file,new_file):
		file_list = self.DirFile[2]
		shutil.copyfile(the_file,new_file)

	def NewDir(self,main_dir,new_dir):
		os.chdir(main_dir)
		the_list = os.listdir()
		print(the_list)
		os.system('mkdir {}'.format(new_dir))

	def RenameFile(self,pre_file,new_name):
		os.rename(the_file,new_name)

	def OpenFile(self,file_name):
		os.system(file_name)

	def RemoveFile(self,re_file):
		os.remove(re_file)
	
	def MoveFile(self,file_now,file_target):
		shutil.move(file_now,file_target)

OperationFile('C:\\Users\\ZXR\\Desktop')